<?php
/**
 * Eren Framework
 * 
 * Factory for Init Session Adapter
 * 
 * @category System
 * @author Manu Soros Leu
 * @copyright manusoros@gmail.com
 */

class Eren_Session
{
    /**
     * Create Session Adapter
     * 
     * @param string $ObjectName
     * @param array $Config
     * @throws Eren_Session_Exception
     * @return Eren_Session_Adapter
     */
    public static function factory($ObjectName = 'Eren_Session_Default', $Config = NULL)
    {
        if($Config && !is_array($Config)){
            throw new Eren_Session_Exception("The second param of factory must be Array");
        }
        return new Eren_Session_Adapter(new $ObjectName($Config));
    }
}